package com.lapian.designmode.flyweight.source_code;

public class IntegerSourceCode {
    public static void main(String[] args) {
        Integer w = new Integer(127);
        Integer x = Integer.valueOf(127);
        Integer y = new Integer(127);
        Integer z = Integer.valueOf(127);
        System.out.println(x.equals(y));
        System.out.println(x==y);
        System.out.println(x==z);
        System.out.println(w==x);
        System.out.println(w==y);
        //valueof
        /**low=-128,high=127
         * public static Integer valueOf(int i) {
         *     if (i >= IntegerCache.low && i <= IntegerCache.high)
         *         return IntegerCache.cache[i + (-IntegerCache.low)];
         *     return new Integer(i);
         * }
         */

    }
}
